<?php 

#if (isset($_COOKIE['licodebug']) && intval($_COOKIE['licodebug']) == 1) {
#   include ('./_config.neu.inc.php'); 
#} else {
   include ('./_config.inc.php'); 
#}


#
if ($_SERVER['SERVER_PORT'] == 443) {

	if($_REQUEST['c']!="login" && $_REQUEST['a']!="login" && $_REQUEST['c']!="register" && $_REQUEST['a']!="register" && $_REQUEST['c']!="forgotten" && $_REQUEST['a']!="forgotten" && $_REQUEST['c']!="profile" && $_REQUEST['a']!="profile") {
		header("Location: ".$lico['baseurl'].$_SERVER["REQUEST_URI"]."");
		exit;
	}
	
}



   
// online users
if ($_SESSION['userid'] >= 1 || (!lico_IsBot($_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']) && trim($_SERVER['HTTP_USER_AGENT']) != "")) {
  $selonline = "SELECT * FROM online WHERE ipaddress='".$_SERVER['REMOTE_ADDR']."'";
  $rowonline = $db->unbuffered_query_first($selonline);
  if (isset($rowonline[0]) && intval($rowonline[0]) >= 1) {
    $qonl = "UPDATE online SET `browser`='".lico_ESC($_SERVER['HTTP_USER_AGENT'])."', `key`='".$_SESSION['userid']."', `stamp`='".time()."' WHERE id='".intval($rowonline[0])."'";
  } else {
    $qonl = "INSERT INTO online SET `ipaddress`='".$_SERVER['REMOTE_ADDR']."', `browser`='".lico_ESC($_SERVER['HTTP_USER_AGENT'])."', `key`='".$_SESSION['userid']."', `stamp`='".time()."'";
  }
  $db->unbuffered_query($qonl);
}
// online bots
if ($_SESSION['userid'] <= 0 && lico_IsBot($_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']) && trim($_SERVER['HTTP_USER_AGENT']) != "") {
  $selonline = "SELECT * FROM online_bots WHERE ipaddress='".$_SERVER['REMOTE_ADDR']."'";
  $rowonline = $db->unbuffered_query_first($selonline);
  if (isset($rowonline[0]) && intval($rowonline[0]) >= 1) {
    $qonl = "UPDATE online_bots SET `browser`='".lico_ESC($_SERVER['HTTP_USER_AGENT'])."', `key`='".$_SESSION['userid']."', `stamp`='".time()."' WHERE id='".intval($rowonline[0])."'";
  } else {
    $qonl = "INSERT INTO online_bots SET `ipaddress`='".$_SERVER['REMOTE_ADDR']."', `browser`='".lico_ESC($_SERVER['HTTP_USER_AGENT'])."', `key`='".$_SESSION['userid']."', `stamp`='".time()."'";
  }
  $db->unbuffered_query($qonl);
}
$db->unbuffered_query("DELETE FROM online WHERE stamp<=".(time()-(86400*16))."");
$db->unbuffered_query("DELETE FROM online_bots WHERE stamp<=".(time()-(86400*16))."");



?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="lico_html_main" dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><?php echo $pagetitle; ?></title>
    <meta name="title" content="<?php echo $pagetitle; ?>" />
    <meta name="page-topic" content="<?php echo $lico['description']; ?>" />
    <meta name="description" content="<?php echo $lico['description']; ?>" />
    <meta name="keywords" content="<?php echo $lico['keywords']; ?>" />
    <meta name="revisit-after" content="3 days" />
    <meta name="robots" content="index, follow" />
    <meta name="content-language" content="<?php echo join(",", $lico['allowed_lang']); ?>" />
    <meta name="copyright" content="<?php echo $lico['title']; ?> - Alexander Löhner" />
    <meta name="author" content="Alexander Löhner" />
    <meta name="publisher" content="<?php echo $lico['title']; ?> - Alexander Löhner" />
    <meta name="resource-type" content="document" />
    <meta name="audience" content="All" />
    <meta name="language" content="<?php echo join(",", $lico['allowed_lang']); ?>" />
	<meta property="og:title" content="<?php echo $pagetitle; ?>" />
	<meta property="og:type" content="non_profit" />
	<meta property="og:url" content="<?php echo $lico['baseurl'].$_SERVER["REQUEST_URI"]; ?>" />
	<meta property="og:image" content="<?php echo $lico['baseurl']; ?>/gfx/tux.png" />
	<meta property="og:site_name" content="<?php echo $pagetitle; ?>" />
	<meta property="fb:admins" content="100001026370586" />
<?php
	
	if ($_SERVER['HTTP_HOST'] != "linuxcounter.net" || $_SERVER['SERVER_PORT'] != 80) {
		
		if (isset($_REQUEST['c']) && trim($_REQUEST['c']) != "" && isset($_REQUEST['a']) && trim($_REQUEST['a']) != "") {
			echo '    <link rel="canonical" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'/'.trim($_REQUEST['a']).'.html" />'."\n";
			echo '    <link rel="alternate" hreflang="' . $_SESSION['lang'] . '" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'/'.trim($_REQUEST['a']).'.html" />'."\n";
		} else if (isset($_REQUEST['c']) && trim($_REQUEST['c']) != "") {
			echo '    <link rel="canonical" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'.html" />'."\n";
			echo '    <link rel="alternate" hreflang="' . $_SESSION['lang'] . '" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'.html" />'."\n";
		} else {
			echo '    <link rel="canonical" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'.html" />'."\n";
			echo '    <link rel="alternate" hreflang="' . $_SESSION['lang'] . '" href="'.$lico['baseurl'].'/'.trim($_REQUEST['c']).'.html" />'."\n";
		}
		
	}
	
	?>
    <meta name="DC.title" content="<?php echo $pagetitle; ?>" />
    <meta name="DC.creator" content="Alexander Löhner" />
    <meta name="DC.subject" content="The New Linux Counter Project" />
    <meta name="DC.description" content="<?php echo $lico['description']; ?>" />
    <meta name="DC.publisher" content="<?php echo $lico['title']; ?> - Alexander Löhner" />
    <meta name="DC.contributor" content="Alexander Löhner" />
    <meta name="DC.date" content="<?php echo gmdate("c", time()); ?>" scheme="DCTERMS.W3CDTF" />
    <meta name="DC.type" content="Text" scheme="DCTERMS.DCMIType" />
    <meta name="DC.format" content="text/html" scheme="DCTERMS.IMT" />
    <meta name="DC.language" content="<?php echo join(",", $lico['allowed_lang']); ?>" scheme="DCTERMS.RFC3066" />
    <meta name="DC.relation" content="http://dublincore.org/" scheme="DCTERMS.URI" />
    <meta name="DC.coverage" content="Munich" scheme="DCTERMS.TGN" />
    <meta name="DC.rights" content="All rights reserverd" />
    <meta name="bitly-verification" content="2f600df3f02c"/>
    <meta name="alexaVerifyID" content="-i5QXGI0mH4tzrenpmbahnBoab0" />
    <meta name="alexaVerifyID" content="mRtP9bc75d3VGwtjuHc4BQ8LaEw" />
    <meta name="wot-verification" content="ba5c152fc4fcfaaf81a9" />
	<meta name="msvalidate.01" content="939955A93B62A79F82049BB84284E4CD" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-script-type" content="text/javascript" />
    <meta http-equiv="content-style-type" content="text/css" />
    <meta http-equiv="content-language" content="<?php echo join(",", $lico['allowed_lang']); ?>" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <?php
    if ((isset($success) && is_array($success) && count($success) >= 1)) {
      if (isset($_GET['resend']) && intval($_GET['resend']) == 1) {
        ?>
        <meta http-equiv="refresh" content="5; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['logout']) && intval($lico['POST']['logout']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['login']) && intval($lico['POST']['login']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_GET['activate']) && trim($_GET['activate']) != "") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['register']) && intval($lico['POST']['register']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "newpasswd") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "sendmessage") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "contactus") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "setprofile") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "deleteaccount") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "massaddmachines1") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['oldpasswd']) && isset($_POST['lico']['firstpasswd']) && isset($_POST['lico']['secondpasswd']) && isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "changepasswd") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "editmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      }
    }
    if ((isset($error) && is_array($error) && count($error) >= 1 && $iserror == 1)) {
      if (isset($_GET['resend']) && intval($_GET['resend']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['logout']) && intval($lico['POST']['logout']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['login']) && intval($lico['POST']['login']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($_GET['activate']) && trim($_GET['activate']) != "") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['register']) && intval($lico['POST']['register']) == 1) {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "newpasswd") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "sendmessage") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($lico['POST']['action']) && trim($lico['POST']['action']) == "contactus") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "setprofile") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "deleteaccount") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "addmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "massaddmachines1") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['oldpasswd']) && isset($_POST['lico']['firstpasswd']) && isset($_POST['lico']['secondpasswd']) && isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "changepasswd") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else if (isset($_POST['lico']['action']) && trim($_POST['lico']['action']) == "editmachine") {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl.ssl']."/profile.html"; ?>">
        <?php
      } else {
        ?>
        <meta http-equiv="refresh" content="8; URL=<?php echo $lico['baseurl']; ?>">
        <?php
      }
    }
    ?>
    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="SHORTCUT ICON" href="/favicon.ico" />
    <link rel="stylesheet" href="/js/jquery-autocomplete/jquery.autocomplete.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/css/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="/css/main.css" />
    <link rel="alternate" type="application/rss+xml" title="RSS Feed: <?php echo $lico['title']; ?>" href="/rss.php" />
    <script src="https://www.google.com/jsapi?key=ABQIAAAAtavR5Bsc6YkBAOzpbaMqChQ9-0XWgZfrMF1dYxh9lB1Nj-DTKhTu_WmOGiTisjH_8Zt89Nx1LPdkuw" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">
      google.load("jquery", "1.7.1");
      google.load("jqueryui", "1.8.17");
    </script>
    <script type="text/javascript" src="/js/jquery-autocomplete/lib/jquery.bgiframe.min.js"></script>
    <script type="text/javascript" src="/js/jquery-autocomplete/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="/js/ajaxhandler.js"></script>
    <script type="text/javascript">
		
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-11402122-4']);
		_gaq.push(['_trackPageview']);
		(function() {
		  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})();
		
	</script>
    <script type="text/javascript">
		
 		(function() {
			var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
			s.type = 'text/javascript';
			s.async = true;
			s.src = 'https://api.flattr.com/js/0.6/load.js?mode=auto';
			t.parentNode.insertBefore(s, t);
		})();
		
	</script>
    <script type="text/javascript">
		
        function calc() {
			var wstart = <?php echo $world_population; ?>;
			var wpersecond = <?php echo $rate; ?>;
			var wsecsince = new Date(<?php echo date("Y"); ?>, <?php echo date("m"); ?>, <?php echo date("d"); ?>, <?php echo date("H"); ?>, <?php echo date("i"); ?>, <?php echo date("s"); ?>);
			var akttime = new Date();
			var wdiff = new Number(akttime - wsecsince)/1000;
			var wpop = (wdiff * wpersecond) + wstart;
			wstr = new String(wpop);
			document.getElementById("worldpop").innerHTML=commafy(wstr);
			var iustart = <?php echo $world_internet_users; ?>;
			var iupersecond = <?php echo $iurate; ?>;
			var iupop = (wdiff * iupersecond) + iustart;
			istr = new String(iupop);
			document.getElementById("internet_user").innerHTML=commafy(istr);
			var lpop = new Number(iupop / 100) * <?php echo $lico['average_linux_users_in_percent']; ?>;
			lstr = new String(lpop);
			document.getElementById("linux_user_guess").innerHTML=commafy(lstr);
			return true;
        }
		function _roundNumber(num,dec) {
			var snum=num.toString()+"000000000000000001";
			var sep=snum.indexOf(".");
			var beg=snum.substring(0,snum.indexOf("."));
			snum=snum.substring(eval(snum.indexOf(".")+1),snum.length);
			var dig=snum.substring(0,eval(dec-1));
			snum=snum.substring(eval(dec-1),dec);
			snum=parseInt(snum);
			gohigher=false;
			if (snum>4) {gohigher=true;}
			if (gohigher) {snum=parseInt(snum);snum++;}
			snum=snum.toString();
			num=beg+"."+dig+""+snum;
			return num;
		}
		function getLoadingTime() {
			if (google.loader.ClientLocation != null) {
				var countrycode = google.loader.ClientLocation.address.country_code;
				var country = google.loader.ClientLocation.address.country;
				var region = google.loader.ClientLocation.address.region;
				var city = google.loader.ClientLocation.address.city;
			} else {
				var countrycode = 'N/A';
				var country = 'N/A';
				var region = 'N/A';
				var city = 'N/A';
			}
			var performance = window.performance || {};
			var perf = performance.timing || {};
			var browserurl = window.location.href;
			var now = new Date().getTime();
			
			var domComplete					= _roundNumber(((now - perf.navigationStart)/1000), 5);				// #####  Loggt in DB
			var loadEventStart				= _roundNumber(((now - perf.domainLookupStart)/1000), 5);
			var domContentLoadedEventEnd	= _roundNumber(((now - perf.domainLookupEnd)/1000), 5);
			var domContentLoadedEventStart	= _roundNumber(((now - perf.fetchStart)/1000), 5);
			var domInteractive				= _roundNumber(((now - perf.requestStart)/1000), 5);
			var unloadEventEnd				= _roundNumber(((now - perf.connectStart)/1000), 5);
			var domLoading					= _roundNumber(((now - perf.connectEnd)/1000), 5);
			var unloadEventStart			= _roundNumber(((now - perf.responseStart)/1000), 5);
			var responseEnd					= _roundNumber(((now - perf.responseEnd)/1000), 5);					// #####  Loggt in DB
			var responseStart				= _roundNumber(((now - perf.unloadEventStart)/1000), 5);			// #####  Loggt in DB
			var connectEnd					= _roundNumber(((now - perf.domLoading)/1000), 5);
			var connectStart				= _roundNumber(((now - perf.unloadEventEnd)/1000), 5);
			var requestStart				= _roundNumber(((now - perf.domInteractive)/1000), 5);				// #####  Loggt in DB
			var fetchStart					= _roundNumber(((now - perf.domContentLoadedEventStart)/1000), 5);
			var domainLookupEnd				= _roundNumber(((now - perf.domContentLoadedEventEnd)/1000), 5);	// #####  Loggt in DB
			var domainLookupStart			= _roundNumber(((now - perf.loadEventStart)/1000), 5);
			var navigationStart				= _roundNumber(((now - perf.domComplete)/1000), 5);
			
			
			$.post("http://linuxcounter.net/ajax.php", { 
				ajax: "1", 
				action: "saveloadtime", 
				domComplete: domComplete, 
				responseEnd: responseEnd, 
				responseStart: responseStart, 
				requestStart: requestStart, 
				domainLookupEnd: domainLookupEnd, 
				url: browserurl, 
				countrycode: countrycode, 
				country: country, 
				region: region, 
				city: city 
			});
			return true;
    	}
		function onLoad() {
			self.getLoadingTime();
			self.calc();
			return true;
		}
		setInterval('self.calc()',1000);
	</script>
	<!-- Quantcast Tag -->
	<script type="text/javascript">
        var _qevents = _qevents || [];

        (function() {
			var elem = document.createElement('script');
			elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
			elem.async = true;
			elem.type = "text/javascript";
			var scpt = document.getElementsByTagName('script')[0];
			scpt.parentNode.insertBefore(elem, scpt);
        })();

        _qevents.push({
			qacct:"p-gahRPaNY4dyfq"
        });
	</script>
  </head>
  <body id="lico-mainpage" onload="return onLoad();">
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
		var js, fjs = d.getElementsByTagName(s)[0];
		if (d.getElementById(id)) return;
		js = d.createElement(s); js.id = id;
		js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=261593073861543";
		fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
	<div id="page-body">

      <div class="wrapper-0">
           <div class="wrapper-1">
                <div class="wrapper-2">
      
                     <div id="header">
                       <div class="header-1">
                         <div class="header-2">
                           <div class="header-3">
                             <div class="header-4">
                               <div id="toolbar">
                                 
                                 
                                 
                                 
                                 
                                 
                               </div>
                               <div id="headerbar">
                                  <?php if ($_SESSION['loggedin'] === true) { ?>
                                  <div id="login-info">
                                    <?php 
                                      if (isset($lico['user']['username']) && trim($lico['user']['username']) != "")
                                        $username = ", ".$lico['user']['username'];
                                      else
                                        $username = "";
                                      echo "<span class=\"bold\">".str_replace("#USERNAMEINFO#", htmlspecialchars($username), lico_lang('general', 'welcome.info'))."</span><br/><br/>";
                                      echo lico_lang('general', 'you.are.logged.in.as.no')." <span class=\"bold\">#".$_SESSION['userid']."</span><br/>";
                                      
                                      $select = "SELECT COUNT(m.f_key) AS num FROM `machines` m WHERE m.`owner`='".$_SESSION['userid']."' AND m.`isactive`='YES'";
                                      $selmach = $db->unbuffered_query_first($select);
                                      $num_active_machines = intval($selmach[0]);
                                      
                                      $select = "SELECT COUNT(m.f_key) AS num FROM `machines` m WHERE m.`owner`='".$_SESSION['userid']."'";
                                      $selmach = $db->unbuffered_query_first($select);
                                      $num_all_machines = intval($selmach[0]);
                                      
                                      echo "<span>".str_replace("#ALLMACHINES#", $num_all_machines, lico_lang('general', 'all.machines.info'))." ";
                                      echo " ".str_replace("#ACTIVEMACHINES#", $num_active_machines, lico_lang('general', 'active.machines.info'))."</span><br/><br/>";
                                       
                                      echo "<span style=\"display: block; text-align: center;\" class=\"bold\">".str_replace("#PROFILELINK#", $lico['baseurl.ssl']."/profile.html", str_replace("#PUBLICLINK#", $lico['baseurl']."/user/".intval($_SESSION['userid']).".html", lico_lang('general', 'personal.page.link')))."</span>";
                                      
                                    ?>
                                  </div>
                                  <?php } ?>
                               </div>
                               <div id="menu">
                                 <ul class="menu">
                                    <li class="level1 first<?php if($_REQUEST['c']=="main" || $_REQUEST['a']=="main") { echo " active current";} ?>"><a class="level1 first<?php if($_REQUEST['c']=="main" || $_REQUEST['a']=="main") { echo " active current";} ?>" href="<?php echo $lico['baseurl']."/"; ?>" title="<?php echo lico_lang('general', 'link.home.title'); ?>"><span><?php echo lico_lang('general', 'link.home'); ?></span></a></li>
                                    <?php if ($_SESSION['loggedin'] === false) { ?>
                                    <li class="level1<?php if($_REQUEST['c']=="login" || $_REQUEST['a']=="login") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="login" || $_REQUEST['a']=="login") { echo " active current";} ?>" href="<?php echo $lico['baseurl.ssl']; ?>/login.html" title="<?php echo lico_lang('general', 'link.login.title'); ?>"><span><?php echo lico_lang('general', 'link.login'); ?></span></a></li>
                                    <li class="level1<?php if($_REQUEST['c']=="register" || $_REQUEST['a']=="register") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="register" || $_REQUEST['a']=="register") { echo " active current";} ?>" href="<?php echo $lico['baseurl.ssl']; ?>/register.html" title="<?php echo lico_lang('general', 'link.register.title'); ?>"><span><?php echo lico_lang('general', 'link.register'); ?></span></a></li>
                                    <?php } else { ?>
                                    <li class="level1<?php if($_REQUEST['c']=="profile" || $_REQUEST['a']=="profile") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="profile" || $_REQUEST['a']=="profile") { echo " active current";} ?>" href="<?php echo $lico['baseurl.ssl']; ?>/profile.html" title="<?php echo lico_lang('general', 'link.profile.title'); ?>"><span><?php echo lico_lang('general', 'link.profile'); ?></span></a></li>
                                    <li class="level1<?php if($_REQUEST['c']=="info" || $_REQUEST['a']=="info") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="info" || $_REQUEST['a']=="info") { echo " active current";} ?>" href="<?php echo $lico['baseurl']; ?>/info.html" title="<?php echo lico_lang('general', 'link.info.title'); ?>"><span><?php echo lico_lang('general', 'link.info'); ?></span></a></li>
                                    <?php } ?>
                                    <li class="level1"><a class="level1" href="http://trac.linuxcounter.net" title="Wiki"><span>Wiki</span></a></li>
                                    <li class="level1"><a class="level1" href="http://trac.linuxcounter.net/report/6" title="Bugtracker"><span>Bugtracker</span></a></li>
                                    <li class="level1<?php if($_REQUEST['c']=="script" || $_REQUEST['a']=="script") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="script" || $_REQUEST['a']=="script") { echo " active current";} ?>" href="<?php echo $lico['baseurl']; ?>/script.html" title="Get the update Script"><span>Update Script</span></a></li>
                                    <li class="level1<?php if($_REQUEST['c']=="news" || $_REQUEST['a']=="news") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="news" || $_REQUEST['a']=="news") { echo " active current";} ?>" href="<?php echo $lico['baseurl']; ?>/news.html" title="<?php echo lico_lang('general', 'link.news.title'); ?>"><span><?php echo lico_lang('general', 'link.news'); ?></span></a></li>
                                    <li class="level1<?php if($_REQUEST['c']=="stats" || $_REQUEST['a']=="stats") { echo " active current";} ?>"><a class="level1<?php if($_REQUEST['c']=="stats" || $_REQUEST['a']=="stats") { echo " active current";} ?>" href="<?php echo $lico['baseurl']; ?>/stats.html" title="<?php echo lico_lang('general', 'link.statistics.title'); ?>"><span><?php echo lico_lang('general', 'link.statistics'); ?></span></a></li>
                                    <li class="level1 last<?php if($_REQUEST['c']=="help" || $_REQUEST['a']=="help") { echo " active current";} ?>"><a class="level1 last<?php if($_REQUEST['c']=="help" || $_REQUEST['a']=="help") { echo " active current";} ?>" href="<?php echo $lico['baseurl']; ?>/help.html" title="<?php echo lico_lang('general', 'link.help.title'); ?>"><span><?php echo lico_lang('general', 'link.help'); ?></span></a></li>
                                 </ul>
                               </div>
                               <div id="search">
                                  <?php if ($_SESSION['loggedin'] === true) { ?>
                                  [ <a id="logout-link" href="<?php echo $lico['baseurl.ssl']; ?>/logout.html" title="<?php echo lico_lang('general', 'link.logout.title'); ?>"><span><?php echo lico_lang('general', 'link.logout'); ?></span></a> ]
                                  <?php } ?>
                               </div>
                             </div>
                           </div>
                         </div>
                       </div>
                     </div>
                     
                     <?php
                     #if (
                     #  ($_REQUEST['c']=="help" || $_REQUEST['a']=="help") ||
                     #) {
                       ?>
                       <div id="submenu">
                         <div id="submenu-1">
                           <div id="submenu-2">
                             <ul class="submenu">
                               <?php
                               
if($_REQUEST['c']=="main" || $_REQUEST['a']=="main") { 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="changelog" || $_REQUEST['a']=="changelog")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="changelog" || $_REQUEST['a']=="changelog")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/changelog/main.html"><span>ChangeLog</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="impressum" || $_REQUEST['a']=="impressum")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="impressum" || $_REQUEST['a']=="impressum")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/impressum/main.html"><span>Impressum</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="disclaimer" || $_REQUEST['a']=="disclaimer")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="disclaimer" || $_REQUEST['a']=="disclaimer")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/disclaimer/main.html"><span>Disclaimer</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="privacy" || $_REQUEST['a']=="privacy")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="privacy" || $_REQUEST['a']=="privacy")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/privacy/main.html"><span>Privacy Policy</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="about" || $_REQUEST['a']=="about")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="about" || $_REQUEST['a']=="about")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/about/main.html"><span>About us</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="contact" || $_REQUEST['a']=="contact")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="contact" || $_REQUEST['a']=="contact")?' sactive scurrent':'').'" href="'.$lico['baseurl'].'/contact/main.html"><span>Contact us</span></a></li>'."\n"; 
}

if($_REQUEST['c']=="login" || $_REQUEST['a']=="login") { 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="forgotten" || $_REQUEST['a']=="forgotten")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="forgotten" || $_REQUEST['a']=="forgotten")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/forgotten/login.html"><span>Lost password?</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="register" || $_REQUEST['a']=="register")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="register" || $_REQUEST['a']=="register")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/register/login.html"><span>Register</span></a></li>'."\n"; 
}

if($_REQUEST['c']=="register" || $_REQUEST['a']=="register") { 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="login" || $_REQUEST['a']=="login")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="login" || $_REQUEST['a']=="login")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/login/register.html"><span>Login</span></a></li>'."\n"; 
}

if($_REQUEST['c']=="profile" || $_REQUEST['a']=="profile") { 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="editprofile" || $_REQUEST['a']=="editprofile")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="editprofile" || $_REQUEST['a']=="editprofile")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/editprofile/profile.html"><span>Edit profile</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="editpref" || $_REQUEST['a']=="editpref")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="editpref" || $_REQUEST['a']=="editpref")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/editpref/profile.html"><span>Set preferences</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="changepasswd" || $_REQUEST['a']=="changepasswd")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="changepasswd" || $_REQUEST['a']=="changepasswd")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/changepasswd/profile.html"><span>Change password</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="addmachine" || $_REQUEST['a']=="addmachine")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="addmachine" || $_REQUEST['a']=="addmachine")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/addmachine/profile.html"><span>Add one new machine</span></a></li>'."\n"; 
  echo '<li class="submenuitem'.(($_REQUEST['c']=="massaddmachine" || $_REQUEST['a']=="massaddmachine")?' sactive scurrent':'').'"><a class="submenuitem'.(($_REQUEST['c']=="massaddmachine" || $_REQUEST['a']=="massaddmachine")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/massaddmachine/profile.html"><span>Add many machines</span></a></li>'."\n"; 
  echo '<li class="submenuitem attantion '.(($_REQUEST['c']=="deleteaccount" || $_REQUEST['a']=="deleteaccount")?' sactive scurrent':'').'"><a class="submenuitem attantion '.(($_REQUEST['c']=="deleteaccount" || $_REQUEST['a']=="deleteaccount")?' sactive scurrent':'').'" href="'.$lico['baseurl.ssl'].'/deleteaccount/profile.html"><span>Delete account</span></a></li>'."\n"; 
}

                               ?>
                             </ul>
                           </div>
                         </div>
                       </div>
                       <?php
                     #}
                     ?>
                     <div id="top">
                        <div class="floatbox ie_fix_floats">
                          <div class="topbox width100 float-left">
                            <div class="moduletable-blank" style="min-height: 100px;">
                              <div class="list">
                                <div id="gradient-box-1" class="gradient-box" style="width: 100%;height: 100px;">
                                  <div class="left" style="overflow: hidden;">
                                    <div class="panel-container-t" style="width: 100%;">
                                      <div class="panel-container-b">
                                        <div class="panel-container-l">
                                          <div class="panel-container-r">
                                            <div class="panel-container-tl">
                                              <div class="panel-container-tr">
                                                <div class="panel-container-bl">
                                                  <div class="panel-container-br" style="height: 85px;">
                                                    
                                                    <div id="headernewsline">
                                                        <div id="TICKER" style="overflow: hidden; width: 813px;" onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false">
                                                            <?php
                                                            $resticker = mysql_query("SELECT * FROM `news` ORDER BY `stamp` DESC LIMIT 0,10");
                                                            while ($tickerrow = mysql_fetch_assoc($resticker)) {
                                                              $id = intval($tickerrow['id']);
                                                              $subject = trim($tickerrow['subject']);
                                                              $text = str_replace("\n", " ", strip_tags(trim($tickerrow['body'])));
                                                              $stamp = intval($tickerrow['stamp']);
                                                              echo "<span class=\"tickeritem\"><a href=\"".$lico['baseurl']."/news.html#".$id."\"><span class=\"tickeritemtitle\">".lico_getdatetime($stamp)."</span><span class=\"tickeritemtext\">".trim($subject)."</span></a></span>";
                                                            }
                                                            ?>
                                                        </div>
                                                        <script type="text/javascript" src="/js/webticker_lib.js" language="javascript"></script>
                                                      <span class="headernews-getScript"><br/>[ <a href="<?php echo $lico['baseurl']; ?>/script.html">Get the (optional!) machine-update script here!</a> ]</span>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                     </div>
					
					<?php if (preg_match("`main|login|register|script`", $_REQUEST['c'])) { ?>
                     <div id="description">
                        <div class="floatbox ie_fix_floats">
                          <div class="topbox width100 float-left">
                            <div class="moduletable-blank" style="min-height: 100px;">
                              <div class="list">
                                <div id="gradient-box-2" class="gradient-box" style="width: 100%;">
                                  <div class="left" style="overflow: hidden;">
                                    <div class="panel-container-t" style="width: 100%;">
                                      <div class="panel-container-b">
                                        <div class="panel-container-l">
                                          <div class="panel-container-r">
                                            <div class="panel-container-tl">
                                              <div class="panel-container-tr">
                                                <div class="panel-container-bl">
                                                  <div class="panel-container-br">
													<?php if ($_REQUEST['c']=="main") { ?>
													  <h1>LiCo - The New LinuxCounter Project - Get counted as a linux user and register your linux boxes</h1>
													  <h2 style="margin-top:10px;">
														  The New LinuxCounter Project was created in order to revive and replace the good old linux counter project on <a href="http://counter.li.org" title="Link to the old counter project">counter.li.org</a>.<br/>
														  Since January 11, 2012 counter.li.org redirects directly to linuxcounter.net and thus, linuxcounter.net is the only and main real linux counter with the greatest userbase.
													  </h2>
													  <h3 style="margin-top:10px;">
														  The original Linux Counter was run by a nonprofit membership organization called the Linux Counter Project. This organization was created on May 1, 1999, taking over the running of the counter from Harald Tveit Alvestrand, who has been running the project since 1993. Harald Alvestrand is chief executive officer of the organization.<br/>
														  <br/>It was started as a "for fun" project to find out how many Linux users there are worldwide. The basic idea is for people to register themselves as being a Linux user. Of course, this way you won't get all Linux users counted as not every Linux user will register himself at the Linux Counter site. Thus, the only way to &quot;know&quot; the number of Linux users worldwide, is to make a guess, preferably a not-too-wild guess of the number of Linux users. Not making wild guesses there is only one way to go: <b>statistics</b>. And so, there we are.<br/>
														  <br/>Also see <a href="http://en.wikipedia.org/wiki/Linux_Counter" title="Link to wikipedia article about the Linux Counter">this wikipedia article</a> for information about the Linux Counter Project. On the 10th of september in 2011, we also were &quot;<a href="http://en.wikipedia.org/wiki/Slashdotted" title="Link to the wikipedia article about what is slashdotted">slashdotted</a>&quot;. <a href="http://linux.slashdot.org/story/11/09/10/1249257/the-linux-counter-relaunches" title="Link to slashdot article about the Linux Counter">See this article here</a>.
													  </h3>
													<?php } else if ($_REQUEST['c']=="login") { ?>
													  <h1>Login to your LiCo account</h1>
													  <h2 style="margin-top:10px;">
														  Here you can login to your linuxcounter.net account using your username or your counter number. You also can make use of the OpenID implementation below.
													  </h2>
													  <h3 style="margin-top:10px;">
														  OpenID is a service with which you can login to many sites using one single user credentials. There are many providers of OpenID. We have implemented the ones from <a href="http://www.golem.de/0810/63249.html" title="Link to the news article about Google becoming an openid provider">Google</a>, <a href="https://www.myopenid.com/" title="Link to myOpenID">myOpenID</a> and <a href="http://openid.net/" title="Link to OpenID">OpenID</a>.
													  </h3>
													<?php } else if ($_REQUEST['c']=="register") { ?>
													  <h1>Register a new LiCo account</h1>
													  <h2 style="margin-top:10px;">
														  Here you can register your own Linux Counter account to get counted as a linux user and to register your own linux machines and boxes.
													  </h2>
													  <h3 style="margin-top:10px;">
														  Every registered user on linuxcounter.net gets an <a href="http://linuxcounter.net/user/249600.html" title="Public Linux Counter profile page of the owner of linuxcounter.net">own profile page</a> which is public to the world. You can  enable or disable many things related to your privacy. You also get a certificate which indicates how many linux machines you own. This certificate is a small picture for use in signatures or similar.<br/>
														  It is planned to provide a unique email address like &quot;username@linuxcounter.net&quot; or &quot;counternumber@linuxcounter.net&quot; to every registered user.
													  </h3>
													<?php } else if ($_REQUEST['c']=="script") { ?>
													  <h1>LiCo machines update script</h1>
													  <h2 style="margin-top:10px;">
														  There is no need to visit this page, login to this page and update your machines by hand every day or once a week. Fortunatly we are providing a script that does the machine update automatically.
													  </h2>
													  <h3 style="margin-top:10px;">
														  Just download and/or install the lico-update script by using the links and description below. It is absolutly safe and will update your machines through the cron daemon.
													  </h3>
													<?php } ?>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                     </div>
					<?php } ?>

                     <div id="middle">





